patches-own

 

Patches-own defines variables that belong exclusively to the patches of a model. (See its counterpart turtles-own for defining turtles’ variables.) The variables are usually a trait or characteristic of the patches; for example if your patches are representing soil in your model, you might use patches-own [ nutrients ]. It has the form of patches-own [ variable1 variable2 ... ], and can include multiple variables as long as they are within the brackets. Like global variables and other agent variables, it must be defined at the top of your code, before any procedure definitions. Patch variables can also be accessed by a turtle that is standing on that patch.

 

Try it Yourself

 
 
 
 
 
 
 

What's next?

Once you mastered the patches-own primitive, don't stop there. Check out the resources below to improve your NetLogo skills.

 
Published NetLogo models that use the patches-own primitive:
 
 
Similar primitives:
turtles-own

Declare a variable that belongs to turtles.

Read more
set

Set the value of a variable.

Read more
of

report the value of an agent-owned variable from another context

Read more
 
Learn another primitive